﻿namespace OnWork.DataCenter.BLL.Standard
{
    /// <summary>
    /// 数据类型
    /// </summary>
    public enum DataType
    {
        /// <summary>
        /// 字符串类型
        /// </summary>
        String = 0,
        /// <summary>
        /// 整型
        /// </summary>
        Int32=1,
        /// <summary>
        /// 布尔类型
        /// </summary>
        Boolean=2,
        /// <summary>
        /// 日期类型
        /// </summary>
        DateTime=3,
        /// <summary>
        /// 数字类型
        /// </summary>
        Decimal,
    }

    /// <summary>
    /// 数据库 列属性
    /// </summary>
    public class DBCol
    {
        /// <summary>
        /// 主键
        /// </summary>
        public string id { get; set; } = Guid.NewGuid().ToString("N");

        /// <summary>
        /// 字段名称
        /// </summary>
        public string ColName { get; set; }

        /// <summary>
        /// 类型
        /// </summary>
        public DataType ColType { get; set; } = DataType.String;

        /// <summary>
        /// jsonPath
        /// </summary>
        public string ColSelectToken { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
        /// <summary>
        /// 是否主键 默认否
        /// </summary>
        public bool IsPK { get; set; } = false;

        /// <summary>
        /// 是否可以为空
        /// </summary>
        public bool IsNullable { get; set; } = false;
        
    }
}